﻿/*****************************************************************************
 * $Workfile:: interruptvectors.c                                            $
 * $Revision:: 19                                                            $
 * $JustDate::  3/21/12                                                      $
 *
 *       GENIE V SLAB
 *       interrupt table
 *****************************************************************************/

#include "common.h"
#include "main.h"
#include "serial.h"
#include "r_cg_intc.h"

/*
void INT_DUMMY( void)
{
    while ( 1)
    {
        ERROR_Abort();
    }
}
*/
#pragma section INTVECTORS  //D

/******************************************************************************
* DEFINE DESCRIPTION
******************************************************************************/

/******************************************************************************
* ENUM DESCRIPTION
******************************************************************************/

/******************************************************************************
* STRUCTURE DESCRIPTION
******************************************************************************/

/******************************************************************************
* CONSTANT DESCRIPTION
******************************************************************************/

/******************************************************************************
* VARIABLE DESCRIPTION
******************************************************************************/

/******************************************************************************
* FUNCTION PROTOTYPE
******************************************************************************/
//#pragma interrupt vInt00(vect=0x00)   // vect 00 defined in cstart.asm
#pragma interrupt vInt01(vect=0x04)
#pragma interrupt vInt02(vect=0x06)
#pragma interrupt vInt03(vect=0x08)
#pragma interrupt vInt04(vect=0x0A)
#pragma interrupt vInt05(vect=0x0C)
#pragma interrupt vInt06(vect=0x0E)
#pragma interrupt vInt07(vect=0x10)
#pragma interrupt vInt08(vect=0x12)
#pragma interrupt vInt09(vect=0x14)
#pragma interrupt vInt10(vect=0x16)
#pragma interrupt vInt11(vect=0x18)
#pragma interrupt vInt12(vect=0x1A)
#pragma interrupt vInt13(vect=0x1C)
#pragma interrupt vInt14(vect=0x1E)
#pragma interrupt vInt15(vect=0x20)
#pragma interrupt vInt16(vect=0x22)
#pragma interrupt vInt17(vect=0x24)
#pragma interrupt vInt18(vect=0x26)
#pragma interrupt vInt19(vect=0x28)
#pragma interrupt vInt20(vect=0x2A)
#pragma interrupt vInt21(vect=0x2C)
#pragma interrupt vInt22(vect=0x2E)
#pragma interrupt vInt23(vect=0x30)
#pragma interrupt vInt24(vect=0x32)
#pragma interrupt vInt25(vect=0x34)
#pragma interrupt vInt26(vect=0x36)
#pragma interrupt vInt27(vect=0x38)
#pragma interrupt vInt28(vect=0x3A)
#pragma interrupt vInt29(vect=0x3C)
#pragma interrupt vInt30(vect=0x3E)
#pragma interrupt vInt31(vect=0x40)
#pragma interrupt vInt32(vect=0x42)
#pragma interrupt vInt33(vect=0x44)
#pragma interrupt vInt34(vect=0x46)
#pragma interrupt vInt35(vect=0x48)
#pragma interrupt vInt36(vect=0x4A)
#pragma interrupt vInt37(vect=0x4C)
#pragma interrupt vInt38(vect=0x4E)
#pragma interrupt vInt39(vect=0x50)
#pragma interrupt vInt40(vect=0x52)
#pragma interrupt vInt41(vect=0x54)
#pragma interrupt vInt42(vect=0x56)
#pragma interrupt vInt43(vect=0x58)
#pragma interrupt vInt44(vect=0x5A)
#pragma interrupt vInt45(vect=0x5C)
#pragma interrupt vInt46(vect=0x5E)
#pragma interrupt vInt47(vect=0x60)
#pragma interrupt vInt48(vect=0x62)
#pragma interrupt vInt49(vect=0x64)
#pragma interrupt vInt50(vect=0x66)
#pragma interrupt vInt51(vect=0x68)
#pragma interrupt vInt52(vect=0x6A)
#pragma interrupt vInt53(vect=0x6C)
#pragma interrupt vInt54(vect=0x6E)
#pragma interrupt vInt55(vect=0x70)
#pragma interrupt vInt56(vect=0x72)

extern void start(void);
static void __near vDummyInt(void);

/******************************************************************************
* FUNCTION DESCRIPTION
******************************************************************************/
#pragma section _vector
const pf_t apfAppVectors[ ] =
{
   start,          // 0 RESET,POR,LVD,WDT,TRAM,IAW,CLM
   vDummyInt,     // 1 INTWDTI
   vDummyInt,     // 2 INTLVI
   vDummyInt,     // 3 INTP0
   vDummyInt,     // 4 INTP1
   vDummyInt,     // 5 INTP2
   vDummyInt,     // 6 INTP3
   vDummyInt,     // 7 INTP4/INTSPM
   r_intc5_interrupt,     // 8 INTP5/INTCMP0
   vDummyInt,     // 9 INTP13/INTCLM
   INT_serial_send,     // 10 INTST0/INTCSI00/INTIIC00
   INT_serial_receive,     // 11 INTSR0/INTCSI01/INTIIC01
   vDummyInt,     // 12 INTTRD0
   vDummyInt,     // 13 INTTRD1
   vDummyInt,     // 14 INTTRJ0
   vDummyInt,     // 15 INTRAM
   vDummyInt,     // 16 INTLIN0TRM
   vDummyInt,     // 17 INTLIN0RVC
   vDummyInt,     // 18 LINTLIN0STA/INTLIN0
   vDummyInt,     // 19 INTIICA0
   vDummyInt,     // 20 INTP8/INTRTC
   vDummyInt,     // 21 INTTM00
   vDummyInt,     // 22 INTTM01
   vDummyInt,     // 23 INTTM02
   vDummyInt,     // 24 INTTM03
   vDummyInt,     // 25 INTAD
   vDummyInt,     // 26 INTP6/INTTM11H
   vDummyInt,     // 27 INTP7/INTTM13H
   vDummyInt,     // 28 INTP9/INTTM01H
   vDummyInt,     // 29 INTP10/INTTM03H
   vDummyInt,     // 30 INTST1/INTCSI10/INTIIC10
   vDummyInt,     // 31 INTSR1/INTCSI11/INTIIC11
   vDummyInt,     // 32 INTTM04
   vDummyInt,     // 33 INTTM05
   vDummyInt,     // 34 INTTM06
   vDummyInt,     // 35 INTTM07
   vDummyInt,     // 36 INTP11/INTLIN0WUP
   vDummyInt,     // 37 INTKR
   vDummyInt,     // 38 INTCAN0ERR
   vDummyInt,     // 39 INTCAN0WUP
   vDummyInt,     // 40 INTCAN0CFR
   vDummyInt,     // 41 INTCAN0TRM
   vDummyInt,     // 42 INTCANGRFR
   vDummyInt,     // 43 INTCANGERR
   vDummyInt,     // 44 INTTM10
   INT_timerV,    // 45 INTTM11
   vDummyInt,     // 46 INTTM12
   vDummyInt,     // 47 INTTM13
   vDummyInt,     // 48 INTFL
   vDummyInt,     // 49 INTP12/INTLIN1WUP
   vDummyInt,     // 50 INTLIN1TRM
   vDummyInt,     // 51 INTLIN1RVC
   vDummyInt,     // 52 INTLIN1STA/INTLIN1
   vDummyInt,     // 53 INTTM14
   vDummyInt,     // 54 INTTM15
   vDummyInt,     // 55 INTTM16
   vDummyInt      // 56 INTTM17
};
#pragma section

/*************************************************************************//**
* @ingroup
* @brief   Handle unexpected interrupt, wait watchdog reset.
* @param   none
* @return  none
*****************************************************************************/
static void __near vDummyInt(void)
{
   while(1)
   {
      DI();
   }
}

/*************************************************************************//**
 Interrrup vector mapping to App vector
*****************************************************************************/
#pragma section _ISR
void __near vInt00(void)
{
   apfAppVectors[0]();
}

void __near vInt01(void)
{
   apfAppVectors[1]();
}

void __near vInt02(void)
{
   apfAppVectors[2]();
}

void __near vInt03(void)
{
   apfAppVectors[3]();
}

void __near vInt04(void)
{
   apfAppVectors[4]();
}

void __near vInt05(void)
{
   apfAppVectors[5]();
}

void __near vInt06(void)
{
   apfAppVectors[6]();
}

void __near vInt07(void)
{
   apfAppVectors[7]();
}

void __near vInt08(void)
{
   apfAppVectors[8]();
}

void __near vInt09(void)
{
   apfAppVectors[9]();
}

void __near vInt10(void)
{
   apfAppVectors[10]();
}

void __near vInt11(void)
{
   apfAppVectors[11]();
}

void __near vInt12(void)
{
   apfAppVectors[12]();
}

void __near vInt13(void)
{
   apfAppVectors[13]();
}

void __near vInt14(void)
{
   apfAppVectors[14]();
}

void __near vInt15(void)
{
   apfAppVectors[15]();
}

void __near vInt16(void)
{
   apfAppVectors[16]();
}

void __near vInt17(void)
{
   apfAppVectors[17]();
}

void __near vInt18(void)
{
   apfAppVectors[18]();
}

void __near vInt19(void)
{
   apfAppVectors[19]();
}

void __near vInt20(void)
{
   apfAppVectors[20]();
}

void __near vInt21(void)
{
   apfAppVectors[21]();
}

void __near vInt22(void)
{
   apfAppVectors[22]();
}

void __near vInt23(void)
{
   apfAppVectors[23]();
}

void __near vInt24(void)
{
   apfAppVectors[24]();
}

void __near vInt25(void)
{
   apfAppVectors[25]();
}

void __near vInt26(void)
{
   apfAppVectors[26]();
}

void __near vInt27(void)
{
   apfAppVectors[27]();
}

void __near vInt28(void)
{
   apfAppVectors[28]();
}

void __near vInt29(void)
{
   apfAppVectors[29]();
}

void __near vInt30(void)
{
   apfAppVectors[30]();
}

void __near vInt31(void)
{
   apfAppVectors[31]();
}

void __near vInt32(void)
{
   apfAppVectors[32]();
}

void __near vInt33(void)
{
   apfAppVectors[33]();
}

void __near vInt34(void)
{
   apfAppVectors[34]();
}

void __near vInt35(void)
{
   apfAppVectors[35]();
}

void __near vInt36(void)
{
   apfAppVectors[36]();
}

void __near vInt37(void)
{
   apfAppVectors[37]();
}

void __near vInt38(void)
{
   apfAppVectors[38]();
}

void __near vInt39(void)
{
   apfAppVectors[39]();
}

void __near vInt40(void)
{
   apfAppVectors[40]();
}

void __near vInt41(void)
{
   apfAppVectors[41]();
}

void __near vInt42(void)
{
   apfAppVectors[42]();
}

void __near vInt43(void)
{
   apfAppVectors[43]();
}

void __near vInt44(void)
{
   apfAppVectors[44]();
}

void __near vInt45(void)
{
   apfAppVectors[45]();
}

void __near vInt46(void)
{
   apfAppVectors[46]();
}

void __near vInt47(void)
{
   apfAppVectors[47]();
}

void __near vInt48(void)
{
   apfAppVectors[48]();
}

void __near vInt49(void)
{
   apfAppVectors[49]();
}

void __near vInt50(void)
{
   apfAppVectors[50]();
}

void __near vInt51(void)
{
   apfAppVectors[1]();
}

void __near vInt52(void)
{
   apfAppVectors[52]();
}

void __near vInt53(void)
{
   apfAppVectors[53]();
}

void __near vInt54(void)
{
   apfAppVectors[54]();
}

void __near vInt55(void)
{
   apfAppVectors[55]();
}

void __near vInt56(void)
{
   apfAppVectors[56]();
}

#pragma section

/******************************************************************************
* End of module
******************************************************************************/

